package com.google.code.jmarias.common;

/**
 * Trida reprezentuje konkretni kartu
 * @author Ondrej Michal
 */
public class Card {

    private Suit suit;
    private Value value;
    public Card() {
    }

    public Card(Suit suit, Value value) {
        this.suit = suit;
        this.value = value;
    }

    public static Card createHiddenCard() {
        return new Card(null, null);
    }

    public int toOrdinal() {
        if (suit == null || value == null) {
            return 0;
        }
        return (suit.ordinal() + 1) * 100 + value.ordinal() + 7;
    }

    @Override
    public String toString() {
        if (suit == null && value == null) {
            return "karta (skryta)";
        }
        return "karta (" + suit + ' ' + value + ')';
    }

    public Suit getSuit() {
        return suit;
    }

    public void setSuit(Suit suit) {
        this.suit = suit;
    }

    public Value getValue() {
        return value;
    }

    public void setValue(Value value) {
        this.value = value;
    }

}
